package com.lm.ddd.infrastructure;

import com.lm.ddd.domain.model.Order;
import com.lm.ddd.domain.repository.OrderRepository;

import java.util.HashMap;
import java.util.Map;

public class InMemoryOrderRepository implements OrderRepository {
    private final Map<String, Order> storage = new HashMap<>();

    @Override
    public void save(Order order) {
        storage.put(order.getOrderId(), order);
    }

    @Override
    public Order findById(String orderId) {
        return storage.get(orderId);
    }
}